/*
 * @# PhotoFavor.java 2011-12-26 下午07:59:59
 * 
 * Copyright (C) 2010 - 2011 广州羿安信息科技有限公司
 * Guangzhou ianswer information technology co. ltd.
 * 
 * All rights reserved!
 */
package com.ianswer.px.album.entity;

import javax.validation.constraints.NotNull;

import com.ianswer.common.util.time.DurationUtils;
import com.ianswer.px.album.io.AlbumPhotoSize;
import com.ianswer.px.user.entity.UserBaseInfo;

/**
 * @author alvin hwang
 */
public class PhotoFavor {

	private Long id;
	@NotNull
	private Long userId;
	@NotNull
	private Long photoId;
	@NotNull
	private Long albumId;
	private Long createdAt;

	private String url;
	private Long authorId;
	private String photoTitle;
	private UserBaseInfo author;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getPhotoId() {
		return photoId;
	}

	public void setPhotoId(Long photoId) {
		this.photoId = photoId;
	}

	public Long getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Long createdAt) {
		this.createdAt = createdAt;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Long getAuthorId() {
		return authorId;
	}

	public void setAuthorId(Long authorId) {
		this.authorId = authorId;
	}

	public String getPhotoTitle() {
		return photoTitle;
	}

	public void setPhotoTitle(String photoTitle) {
		this.photoTitle = photoTitle;
	}

	public UserBaseInfo getAuthor() {
		return author;
	}

	public void setAuthor(UserBaseInfo author) {
		this.author = author;
	}

	public Long getAlbumId() {
		return albumId;
	}

	public void setAlbumId(Long albumId) {
		this.albumId = albumId;
	}

	public String getH160Path() {
		return AlbumPhotoSize.H160.path(url);
	}
	
	public String getCreatedAtDuration() {
		return DurationUtils.seconds(createdAt);
	}
}
